﻿
using System;
using System.Linq.Expressions;

namespace Easy.Domain.Core.Specification
{
    public sealed class DirectSpecification<T> : Specification<T> where T : class
    {

        Expression<Func<T, bool>> _MatchingCriteria;

        public DirectSpecification(Expression<Func<T, bool>> matchingCriteria)
        {
            Easy.Common.CheckHelper.NotNull(matchingCriteria, "matchingCriteria");

            _MatchingCriteria = matchingCriteria;
        }

        public override Expression<Func<T, bool>> SatisfiedBy()
        {
            return _MatchingCriteria;
        }
    }
}
